#! /usr/bin/env python

PACKAGE='image_proc'

from dynamic_reconfigure.parameter_generator_catkin import *

gen = ParameterGenerator()

# Decimation parameters
gen.add("decimation_x", int_t, 0, "Number of pixels to decimate to one horizontally", 1, 1, 16)
gen.add("decimation_y", int_t, 0, "Number of pixels to decimate to one vertically", 1, 1, 16)

# ROI parameters
# Maximums are arbitrary set to the resolution of a 5Mp Prosilica, since we can't set
# the dynamically.
gen.add("x_offset",     int_t, 0, "X offset of the region of interest", 0, 0, 2447)
gen.add("y_offset",     int_t, 0, "Y offset of the region of interest", 0, 0, 2049)
gen.add("width",        int_t, 0, "Width of the region of interest", 0, 0, 2448)
gen.add("height",       int_t, 0, "Height of the region of interest", 0, 0, 2050)

interpolate_enum = gen.enum([ gen.const("NN",       int_t, 0, "Nearest-neighbor sampling"),
                              gen.const("Linear",   int_t, 1, "Bilinear interpolation"),
                              gen.const("Cubic",    int_t, 2, "Bicubic interpolation over 4x4 neighborhood"),
                              gen.const("Area",     int_t, 3, "Resampling using pixel area relation"),
                              gen.const("Lanczos4", int_t, 4, "Lanczos interpolation over 8x8 neighborhood")],
                            "interpolation type")

gen.add("interpolation", int_t, 0,
        "Sampling algorithm",
        0, 0, 4, edit_method = interpolate_enum)

# First string value is node name, used only for generating documentation
# Second string value ("CropDecimate") is name of class and generated
#    .h file, with "Config" added, so class CropDecimateConfig
exit(gen.generate(PACKAGE, "image_proc", "CropDecimate"))
